#ifndef _OBJECTHANDLER_H_
#define _OBJECTHANDLER_H_

//////// objectHandler.h /////////////////////////////////////////////////
//    Author:        Richard (richard.lindholm85@gmail.com)             //
//    Project:    some game project                                     //
//    Version:    0.1                                                   //
//    Purpose:    objectHandler class,                                  //
//                Handle for all objects, players, enemies, etc         //
//    Comments:    Maybe I should use K.I.S.S. (Keep It Simple Stupid)  //
//                more                                                  //
//////////////////////////////////////////////////////////////////////////

#include <string>
#include <vector>
#include "object.h"
#include "player.h"

;
class cObjectHandler
{
public:
    cObjectHandler();
    ~cObjectHandler();

    /// Object Functions ///
    void newObject(INTPOINT pos, INTPOINT size, unsigned int type, string name = "__NULL");
    /* TODO: add some removeObject functions here later */

    void updateObjects();

    int getNumObjects();

    cGameObject * getObjectByName(const char * name);
    cGameObject * getObjectByName(std::string name);
    cGameObject * getObjectAt(int value);

    cGameObject * getCurrentObject();
    void setCurrentObject(cGameObject * obj);
    void setCurrentObject(std::string name);
    void setCurrentObject(const char * name);


    /// Player Functions ///
    void newPlayer(int startX, int startY, int width, int height, std::string playerName);
    /* TODO: add some removePlayer functions here later */

    void updatePlayers();

    int getNumPlayers();

    cPlayer * getPlayerByName(const char * name);
    cPlayer * getPlayerByName(std::string name);
    cPlayer * getPlayerAt(int value);

    cPlayer * getCurrentPlayer();
    void setCurrentPlayer(cPlayer * player);
    void setCurrentPlayer(std::string name);
    void setCurrentPlayer(const char * name);
        
    unsigned int isColliding(cGameObject * objA, cGameObject * objB);

private:
    cGameObject * m_pCurrentObject;
    cPlayer * m_pCurrentPlayer;

    vector<cGameObject *> m_ObjectList;
    vector<cPlayer *> m_PlayerList;
}



#endif